//package com.scut.project.controller;
//
//
//import com.scut.project.entity.Feedback;
//import com.scut.project.entity.ShortAnswerQuestion;
//import com.scut.project.service.InterviewService;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.web.bind.annotation.*;
//import org.springframework.web.multipart.MultipartFile;
//
//import java.io.IOException;
//import java.io.InputStream;
//import java.util.List;
//
///**
// * <p>
// * 面试流程记录 前端控制器
// * </p>
// *
// * @author Kevin Zheng
// * @since 2024-10-15
// */
//@RestController
//@RequestMapping("/api/interview")
//public class InterviewController {
//
//    @Autowired
//    private InterviewService interviewService;
//
//    @GetMapping("/questions")
//    public List<ShortAnswerQuestion> getQuestions(@RequestParam Long interviewId) {
//        return interviewService.getQuestions(interviewId);
//    }
//
//    @PostMapping("/submit-answer")
//    public Feedback submitAnswer(@RequestParam Long questionId,
//                                 @RequestParam("voiceInput") MultipartFile voiceInput,
//                                 @RequestParam Long candidateId) {
//        try (InputStream inputStream = voiceInput.getInputStream()) {
//            // 将语音转为文本
//            String answerText = interviewService.processVoiceInput(inputStream);
//            // 评估回答并获取反馈
//            return interviewService.evaluateAndSaveAnswer(questionId, answerText, candidateId);
//        } catch (IOException e) {
//            throw new RuntimeException("Failed to process voice input", e);
//        }
//    }
//}
//
//
